.<template>
  <div >
    <router-view />
     <van-tabbar @change="changePage" v-model="active">
      <van-tabbar-item v-for="(v,index) in tabber" :key="index" :to="v.path" :icon="v.icon">{{v.text}}</van-tabbar-item>
     </van-tabbar>
  </div>
</template>

<script>
export default {
data() {
    return {
      active: 0,
      tabber:[{
        path:"/home/homes",
        icon:"newspaper-o",
        text:"首页",
        active:0
      },
      {
        path:"/home/change",
        icon:"exchange",
        text:"兑换",
        active:1
      },{
        path:"/home/keep",
        icon:"free-postage",
        text:"寄存柜",
        active:2
      },{
        path:"/home/my",
        icon:"manager-o",
        text:"我的",
        active:3
      },
      ],
    };
  },
  methods: {
    changePage(active) {
        console.log(active)
    }
  },
  created() {
    this.active = this.tabber.filter(item=>item.path===this.$route.path)[0].active
  },
}
</script>

<style>

</style>